<?php
/*
	
*/
defined('BY_JYA') or exit('Access Denied');
global $_RQ,$_AR;

$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
$return=array();
$return['diy']=$this->plugin_setting('diy');
$basic=$this->plugin_setting('basic');
$setting=$this->plugin_setting('basic');
$return['banner']=$basic['image'];
$return['setting']=$setting;
if($_RQ['op']=='main'){
	/*******main*******/
	//首页公司/设计师
	$company=pdo_getall('jy_cmsdecorate_company',array('uniacid'=>$_SESSION['uniacid'],'isshow'=>'1','status'=>'1'));
	if($company){
		foreach($company as &$item){
			$num1=pdo_count('jy_cmsdecorate_order',array('uniacid'=>$_SESSION['uniacid'],'cid'=>$item['id'],'status'=>'1'));
			$num2=pdo_count('jy_cmsdecorate_order',array('uniacid'=>$_SESSION['uniacid'],'cid'=>$item['id'],'status'=>'2'));
			$num3=pdo_count('jy_cmsdecorate_order',array('uniacid'=>$_SESSION['uniacid'],'cid'=>$item['id'],'status'=>'4'));
			$item['num']=$num1+$num2+$num3;
		}
	}
	$stylist=pdo_getall('jy_cmsdecorate_stylist',array('uniacid'=>$_SESSION['uniacid'],'isshow'=>'1','status'=>'1'));
	if($serve_show){
		foreach($serve_show as &$item){
			$num1=pdo_count('jy_cmsdecorate_order',array('uniacid'=>$_SESSION['uniacid'],'sid'=>$item['id'],'status'=>'1'));
			$num2=pdo_count('jy_cmsdecorate_order',array('uniacid'=>$_SESSION['uniacid'],'sid'=>$item['id'],'status'=>'2'));
			$num3=pdo_count('jy_cmsdecorate_order',array('uniacid'=>$_SESSION['uniacid'],'sid'=>$item['id'],'status'=>'4'));
			$item['num']=$num1+$num2+$num3;
		}
	}
	$return['company']=$company;
	$return['stylist']=$stylist;
	exi($return);
}